package model;

import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics;

import controller.Global;

public class HUD {
	
	public void render(Graphics g) {
		int dx = (int) Global.player.getPosition().x;
		int dy = (int) Global.player.getPosition().y;

		g.setColor(new Color(256, 256, 256));

		g.drawString("Press CTRL-Q to exit the program", Global.screenX - 300,
				10);
		g.drawString("Player location (" + dx + "," + dy + ")", 10, 30);
		g.drawString("Mouse location  (" + Global.mouseX + "," + Global.mouseY + ")", 10, 50);
		g.drawString("Magnification   x " + Global.zoom, 10, 70);
		g.drawString(
				"Ground speed      " + Global.player.getLinearVelocity().x, 10,
				90);
		g.drawString("Angular velocity  " + Global.player.getAngularVelocity(),
				10, 110);
		g.drawString("Is Jumping?       "
				+ ((Entity) Global.player.getUserData()).isJumping, 10, 130);
		g.drawString("Velocity Vector   ("
				+ Global.player.getLinearVelocity().x + ","
				+ Global.player.getLinearVelocity().y + ")", 10, 150);
		g.drawString("Health             "
				+ ((Entity)Global.player.getUserData()).health, 10, 170);
		
		// draw keyboard command instructions
		g
				.drawString(
						"arrows to move | Q/E to spin | +/- (or mouse wheel) to zoom | spacebar fires",
						10, Global.screenY - 40);
		g.drawString("right menu or click to select, left mouse places, right mouse deselects, DEL deletes", 10,
				Global.screenY - 20);

		// show text when game is paused
		if (Global.stage.paused) {
			g.setColor(new Color(0, 0, 0));
			g.drawString("*** GAME PAUSED ***", Global.screenX - 279, 36);
			g.setColor(new Color(255, 0, 0));
			g.drawString("*** GAME PAUSED ***", Global.screenX - 280, 35);
		}
	}
}
